function padZero(num) {
    return num > 9 ? num : `0${num}`;
}
function dateToString(date) {
    const year = date.getFullYear();
    const month = padZero(date.getMonth() + 1);
    const day = padZero(date.getDate());
    const hour = padZero(date.getHours());
    const min = padZero(date.getMinutes());
    const second = padZero(date.getSeconds());
    return `${year}-${month}-${day} ${hour}:${min}:${second}`;
}
module.exports = dateToString;